Interrupt 21h Function 71A7h Minor Code 0h 

Converts a 64-bit file time to MS-DOS date and time values.

mov ax, 71A7h           ; date and time format conversion

mov bl, 0               ; File Time To DOS Time

mov si, seg lpft        ; see below

mov ds, si

mov si, offset lpft

int 21h

 

jc  error

mov [DOSTime], cx

mov [DOSDate], dx

mov [MilliSeconds], bh  ; number of 10ms intervals in 2 seconds

 

Parameters

lpft

Address of a FILETIMEA44M8H structure containing the 64-bit file time to convert to the MS-DOS date and time format.

 

Return Value

Clears the carry flag, and sets the BH, CX, and DX registers to these values if successful:

BH

Number of 10 millisecond intervals in 2 seconds to add to the MS-DOS time. It can be a value in the range 0 to 199.

CX

MS-DOS time. The time is a packed 16-bit value with the following form:

 

Bits

Contents

0-4

Second divided by 2

5-10

Minute (0-59)

11-15

Hour (0-23 on a 24-hour clock)

 

DX

MS-DOS date. The date is a packed 16-bit value with the following form:

 

Bits

Contents

0-4

Day of the month (1-31)

5-8

Month (1 = January, 2 = February, and so on)

9-15

Year offset from 1980 (that is, add 1980 to get the actual year)

 

Otherwise, the function sets the carry flag and sets the AX register to an error value.

Remarks

The MS-DOS date format can represent only dates between 1/1/1980 and 12/31/2107; this conversion fails if the input file time is outside this range.

The time in FILETIME must be Coordinated Universal Time (UTC). The MS-DOS time is local time.